package com.wyq.new_springboot.config.redis;

import com.wyq.new_springboot.entity.TBlog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;

/**
 * redis配置类
 * @Author weiyaqiang
 * @create 2021/4/2 10:04
 */
@Configuration
public class RedisConfig {

    @Bean
    public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory){
        RedisTemplate<String, String> template=new RedisTemplate<String,String>();
        template.setConnectionFactory(factory);
        return template;
    }
}
